1. Technical Field
The present disclosure relates to the processing of image data, and in particular, a process for separating the colors of an image coming from an image sensor.
2. Description of the Related Art
An image sensor generally has a matrix structure each element of which corresponds to a pixel of the image. The sensor is associated with a read circuit which sequentially supplies the value of each pixel by reading the value of each pixel line by line, from the pixel located in the top left-hand corner of the image to the pixel located in the bottom right-hand corner of the image for example. To supply a piece of color information, each pixel is associated with an elementary color filter having one of the three primary colors red, green, or blue. The primary color filters of the image sensor are distributed according to a color filter pattern which can be of the Bayer type. A color filter pattern of the Bayer type comprises a basic pattern of 2×2 pixels which is repeated in lines and in columns, so as to cover all the pixels of the image sensor. The basic pattern of a Bayer filter comprises a red primary filter associated, on a same line and a same column, with green primary filters, and a blue primary filter arranged diagonally in relation to the red filter, the two green primary filters possibly being identical or different. Thus, a basic Bayer pattern can have the following color distribution:
RGRGBBin which R represents the red filter, GR the green filter on the same line as the red filter, B the blue filter and GB the green filter on the same line as the blue filter. In the following, the expression “color plane” means all the pixels of an image associated with a same primary filter color. An image supplied by an image sensor associated with a Bayer filter thus comprises four color planes, each corresponding to the color R, GR, GB, B of one of the four primary filters of the basic Bayer pattern.
Some image processing operations, and particularly the image compression processing operations, are typically preceded by process of separating the pixels of the image into color planes or of reorganizing the pixels in blocks or in segments each having pixels of several lines. Some of these processing operations do not apply to all the pixels of a color plane simultaneously, but to a few lines only. In some applications, it can be desirable for such a processing operation of color plane separation or reorganization to be performed on the fly, at the same rate as the pixels of the image coming from the image sensor are received, i.e., at the “pixel” frequency, to successively supply several lines of pixels of a same color plane or several blocks of pixels.
If the image processing applies to two successive lines of pixels from a same color plane of an image having a Bayer distribution, to perform the separation of color planes, two successive complete lines of the image can be stored, only one of the two lines having pixels of the color plane being separated. The separation process, in order to produce a block of two lines of a same color plane, can then be performed on the fly. That is, the separation process can be performed as and when the pixels of a third line, which comprises the pixels of a second line of the color plane, are received. It results therefrom that, during the storing of the first two complete lines of an image, the color plane separation process does not supply any pixel to the following process, such as an image compression process for example. After receiving a third image line, the separation process successively supplies two blocks of two image lines of the two color planes to which the third image line belongs. Upon receiving a fourth image line, the separation process successively supplies two blocks of two image lines of the two color planes to which the fourth image line belongs. If the image lines are desired to be supplied to the following processing operation at the rate at which the separation process receives the pixels, at least one of the two blocks of pixels of two color planes corresponding to two image lines can be stored and transmitted when the two complete image lines are stored.
More generally, if blocks from more than two successive lines of pixels of a same color plane are desired be supplied by the separation process, the number of lines of the image to be stored is equal to 2(n−1), n being the number of successive lines of pixels of a same color plane to be supplied.
In order to implement the process of separating the color planes by means of an integrated circuit, or more generally a process of reorganizing data in a data flow, it can be desirable to reduce the size of the memory and of the circuits employed to implement that process.